import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import 'element-plus/es/hooks/use-locale/index';
import "element-plus/theme-chalk/el-loading.css";
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import "element-plus/theme-chalk/el-message.css";
import ElementPlus from 'element-plus'
import "element-plus/theme-chalk/el-notification.css";

import "element-plus/theme-chalk/el-message-box.css";

import "element-plus/theme-chalk/el-drawer.css";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const pinai = createPinia()
pinai.use(piniaPluginPersistedstate)
const app = createApp(App).use(pinai)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(ElementPlus, {
  locale: zhCn,
})
// @ts-ignore
import { roleStore } from '@/stores/role.js';
const  rolestore = roleStore()
rolestore.addrouter()
app.use(router)
app.mount('#app')
